package com.contextor.magiccards.dao.utils;

/**
 * User: Sergey
 * Date: 02.04.2011 14:01:12
 */
public class Pager {
    public int currentPage = 1;
    public int totalCount = -1;
    public int itemsPerPage = 20;

    public int from() {
        return currentPage == 1 ? 0 : currentPage * itemsPerPage;
    }

    public int till() {
        return currentPage == 1 ? itemsPerPage : itemsPerPage * currentPage + itemsPerPage;
    }

}
